<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        // var cat = "[wamd]";
        // var ptt = /[abc]/;
        // var str = "swswswswswswswswswswswswswswswswswsw";
        // ptt = new RegExp(cat);
        // console.log(ptt.test(str));
        // ptt = /[\D]/;
        // str = "2w";
        // console.log(ptt.test(str));
        // ptt = /a?/;
        // console.log(ptt.test(str));
        // ptt = /./;
        // str = "wsswswdkejciodo1";
        // console.log(ptt.test(str));
        // ptt = /\w/;
        // str = "?????*****";
        // console.log(ptt.test(str));
        // ptt = /\W/;
        // console.log(ptt.test(str));
        // ptt = /d?/;
        // str = "sdad"
        // console.log(ptt.test(str));
        // ptt = /[?ji]+/;
        // str = "cswer";
        // console.log(ptt.test(str));
        // ptt = /\b[\w.%+-]+@[\w.-]+\.[a-zA-Z]{2,6}\b/g;
        // str = "abcd test@runoob.com 1234";
        // console.log(ptt.test(str));
        // ptt = /b?d{4,}[nvsb]{1,}[ ]{1,}/;
        // str = "bddddbnv*";
        // console.log(ptt.test(str));
        // var ptt = /^1[(3[0-9)]|(5[3689]{1})][0-9]{8}$/;
        // var str = "123456666666666666";
        // console.log(ptt.test(str));
        // var ptt = /(?=.*[A-Z])(?=.*[a-z])(?=.*\d)[0-9a-zA-Z.?!@#]{6,16}/;
        // var str = 'SSDH1JJEKJKSJa';
        // console.log(ptt.test(str));
        // var ptt = /(^-?([1-9][0-9]*)?\d(?=\.)){1}\d/;
        // var num = '-101';
        // console.log(ptt.test(num));
        // var ptt = /^\w+@\w+\.com$/;
        // var ptt = /^(\w*\.*-*)+@(\w*\.*-*)+\.(\w*\.*-*)+$/;

        // var ptt = /<h[1-6]{1}>(.*?)<\/h[1-6]{1}>/ig;
        // var str = "<h1>这是h1</h1><h3>这是h3</h3>";
        // var arr = [];
        // str.match(ptt).forEach((value) => {
        //     arr.push(value.split(/<h[1-6]>/i)[1].split(/<\/h[1-6]/i)[0]);
        // });
        // console.log(arr);

        var str = `2-hagh-sibba.mp3
            audb-habzgv.mp3
            gauzb-uabxg-hwgs-s.mp3;`;
        var ptt = /-(.*?)(?=-?)\.mp3/ig;
        console.log(str.match(ptt));
        console.log(RegExp.$1);
        //exec,
    </script>
</body>
</html>